/*
 * @Author       : tongzonghua
 * @Date         : 2020-10-27 16:39:18
 * @LastEditors  : tongzonghua
 * @LastEditTime : 2020-10-27 16:39:21
 * @Email        : tongzonghua@360.cn
 * @Description  : 
 * @FilePath     : /cli/aframe-boilerplate/components/setSky.js
 */
AFRAME.registerComponent('set-sky', {
  schema: { default: '' },
  init() {
    const sky = document.querySelector('a-sky');

    this.el.addEventListener('click', () => {
      sky.setAttribute('src', this.data);
    });
  }
});